import com.tgy.dao.BaseDao;
import org.junit.Test;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/***
 * @ClassName: test
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 16:57 2021/12/9
 * @version : V1.0
 */
public class test {
    public static void main(String[] args) throws SQLException {
        System.out.println("666");
    }

    @Test
    public void aaa() throws SQLException {
        DataSource datasource = BaseDao.getDatasource();
        Connection connection = datasource.getConnection();
        String s = "select * from smbms_user";
        PreparedStatement preparedStatement = connection.prepareStatement(s);
        ResultSet resultSet = preparedStatement.executeQuery();
        while (resultSet.next()) {
            System.out.println(resultSet.getString("userName"));
        }
    }
@Test
    public void bb() throws SQLException {

        String[] list = {"1"};
        //String[] list = new String[10];
        ResultSet execute = BaseDao.execute(1, BaseDao.getC(), "select * from smbms_user ", null);
            while (execute.next()) {
                System.out.println(execute.getString("userName"));
            }
        }
}
